import com.itheima.config.SpringConfig;
import com.itheima.domain.Account;
import com.itheima.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {
    public static void main(String[] args) {
        //加载核心配置文件
        ApplicationContext ctx=new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取数据源
       ctx.getBean("dataSource");

        AccountService accountService = (AccountService) ctx.getBean("accountService");
        Account b2 = accountService.findById(2);
        System.out.println(b2);


    }
}
